package cn.itsource.org.service.impl;

import cn.itsource.base.service.impl.BaseServiceImpl;
import cn.itsource.org.domain.Employee;
import cn.itsource.org.domain.Shop;
import cn.itsource.org.mapper.EmployeeMapper;
import cn.itsource.org.mapper.ShopMapper;
import cn.itsource.org.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;
    @Autowired
    private ShopMapper shopMapper;

    @Override
    public List<Employee> selectShopEmployee(Long shopId) {
        Shop shop = shopMapper.selectByLoginId(shopId);
        if(shop == null){
            return null;
        }
        return employeeMapper.selectShopEmployee(shop.getId());
    }
}
